﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using LibHuman;
namespace Human
{
	/// <summary>
	/// Summary description for frmThongKeNhanSu.
	/// </summary>
	public class frmThongKeNhanSu : System.Windows.Forms.Form
	{
		private AccessData  mDB=new AccessData ();
		private DataSet ds =new DataSet();
        Language lan = new Language();
        string m_user = "",ngay = "",s_bophan="",user_dn="";		
		private System.Windows.Forms.Button butThoat;
		private System.Windows.Forms.Button butIn;
		private System.Windows.Forms.Button butXem;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.NumericUpDown cbobThang;
        private System.Windows.Forms.NumericUpDown cbobNam;
		private System.ComponentModel.Container components = null;

		public frmThongKeNhanSu(string s_makp,string s_userdn)
		{
			InitializeComponent();
            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            s_bophan = s_makp;
            user_dn = s_userdn;
		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmThongKeNhanSu));
            this.butThoat = new System.Windows.Forms.Button();
            this.butIn = new System.Windows.Forms.Button();
            this.butXem = new System.Windows.Forms.Button();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.cbobThang = new System.Windows.Forms.NumericUpDown();
            this.cbobNam = new System.Windows.Forms.NumericUpDown();
            ((System.ComponentModel.ISupportInitialize)(this.cbobThang)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.cbobNam)).BeginInit();
            this.SuspendLayout();
            // 
            // butThoat
            // 
            this.butThoat.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butThoat.Image = ((System.Drawing.Image)(resources.GetObject("butThoat.Image")));
            this.butThoat.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butThoat.Location = new System.Drawing.Point(143, 63);
            this.butThoat.Name = "butThoat";
            this.butThoat.Size = new System.Drawing.Size(60, 28);
            this.butThoat.TabIndex = 17;
            this.butThoat.Text = "Thoát";
            this.butThoat.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.butThoat.Click += new System.EventHandler(this.butThoat_Click);
            // 
            // butIn
            // 
            this.butIn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butIn.Image = ((System.Drawing.Image)(resources.GetObject("butIn.Image")));
            this.butIn.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butIn.Location = new System.Drawing.Point(77, 63);
            this.butIn.Name = "butIn";
            this.butIn.Size = new System.Drawing.Size(60, 28);
            this.butIn.TabIndex = 16;
            this.butIn.Text = "In";
            this.butIn.Click += new System.EventHandler(this.butIn_Click);
            // 
            // butXem
            // 
            this.butXem.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butXem.Image = ((System.Drawing.Image)(resources.GetObject("butXem.Image")));
            this.butXem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butXem.Location = new System.Drawing.Point(11, 63);
            this.butXem.Name = "butXem";
            this.butXem.Size = new System.Drawing.Size(60, 28);
            this.butXem.TabIndex = 15;
            this.butXem.Text = "  Xem";
            this.butXem.Click += new System.EventHandler(this.butXem_Click);
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(103, 26);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(43, 16);
            this.label2.TabIndex = 12;
            this.label2.Text = "Năm :";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(8, 26);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(53, 16);
            this.label1.TabIndex = 11;
            this.label1.Text = "Tháng :";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // cbobThang
            // 
            this.cbobThang.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbobThang.ForeColor = System.Drawing.Color.DarkBlue;
            this.cbobThang.Location = new System.Drawing.Point(54, 26);
            this.cbobThang.Maximum = new decimal(new int[] {
            12,
            0,
            0,
            0});
            this.cbobThang.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.cbobThang.Name = "cbobThang";
            this.cbobThang.Size = new System.Drawing.Size(43, 20);
            this.cbobThang.TabIndex = 18;
            this.cbobThang.Value = new decimal(new int[] {
            11,
            0,
            0,
            0});
            // 
            // cbobNam
            // 
            this.cbobNam.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbobNam.ForeColor = System.Drawing.Color.DarkBlue;
            this.cbobNam.Location = new System.Drawing.Point(143, 26);
            this.cbobNam.Maximum = new decimal(new int[] {
            9999,
            0,
            0,
            0});
            this.cbobNam.Minimum = new decimal(new int[] {
            2002,
            0,
            0,
            0});
            this.cbobNam.Name = "cbobNam";
            this.cbobNam.Size = new System.Drawing.Size(56, 20);
            this.cbobNam.TabIndex = 18;
            this.cbobNam.Value = new decimal(new int[] {
            2005,
            0,
            0,
            0});
            // 
            // frmThongKeNhanSu
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(215, 116);
            this.Controls.Add(this.cbobThang);
            this.Controls.Add(this.butThoat);
            this.Controls.Add(this.butIn);
            this.Controls.Add(this.butXem);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.cbobNam);
            this.ForeColor = System.Drawing.Color.DarkBlue;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "frmThongKeNhanSu";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Thống kê nhân sự";
            this.Load += new System.EventHandler(this.frmThongKeNhanSu_Load);
            ((System.ComponentModel.ISupportInitialize)(this.cbobThang)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.cbobNam)).EndInit();
            this.ResumeLayout(false);

		}
		#endregion

		private void butThoat_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void print(bool prn)
		{			
			ds=null;
			DataSet adst= new DataSet();

            string m_thang = "", m_nam = "";
            m_thang = cbobThang.Value.ToString().PadLeft(2,'0');
            m_nam = cbobNam.Value.ToString();

			string sql1="SELECT '' as LABEL,Count(l.manv) AS TongNV, sum(case when l.phai='Nữ' then 1 else 0 end) AS nv_Nu,";
            sql1 += " sum(case when l.phai='Nam' then 1 else 0 end) AS nv_Nam, ";
            sql1 += " sum(case when hd.dang='c' or hd.dang='r' Or hd.dang='C' Or hd.dang='R' then 1 else 0 end) AS Dang_v,";
			sql1+=" sum(case when hd.doan='c' Or hd.doan='r' Or hd.doan='C' Or hd.doan='R' then 1 else 0 end)";
            sql1 += " AS Doan_v, sum(case when hd.cong_doan='c' Or hd.cong_doan='r' Or";
			sql1+=" hd.cong_doan='C' Or hd.cong_doan='R' then 1 end) AS CongDoan_v,";
            sql1 += " sum(case when l.mahv in ('0009','0008')  then 1 else 0 end) AS cap1, sum(case when l.mahv in ('0004','0005','0006','0007') then 1 else 0 end ) AS";
            sql1 += " cap2, sum(case when l.mahv in ('0001','0002','0003') then 1 else 0 end) AS cap3, sum(case when bc.mabc in ('DH') then 1 else 0 end )";
            sql1 += " AS daihoc,sum(case when bc.mabc in ('TD') then 1 else 0 end )  AS trendh,";
			sql1+=" sum(case when l.chinhtri='SC' then 1 else 0 end) AS SC_CTri, ";
            sql1+=" sum(case when l.chinhtri='TC' then 1 else 0 end) AS TC_CTri,";
            sql1 += " sum(case when l.chinhtri='CN' then 1 else 0 end) AS CN_CTri,";
            sql1 += " sum(case when l.chinhtri='CC' then 1 else 0 end) AS CC_CTri,";
            sql1 += " sum(case when bc.mabc in ('SH') then 1 else 0 end) AS SH_Cmon, ";
            sql1 += " sum(case when bc.mabc in ('TH') then 1 else 0 end) AS TH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('DH') then 1 else 0 end) AS DH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('TD') then 1 else 0 end) AS TDH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('CD') then 1 else 0 end) AS CD_Cmon,";
            sql1+="  to_char(now(),'dd') as ngay,'"+m_thang+"' as thang,'"+m_nam+"' as nam ";
            sql1 += " From " + m_user + ".llnv l inner join " + m_user + ".hopdong hd on hd.manv=l.manv";
            sql1 += " left join "+m_user+".bophan bp on l.madv=bp.madv";
            sql1 += " left join " + m_user + ".mahd m on m.mahd=hd.loaihd";
            sql1 += " left join " + m_user + ".hocvan hv on hv.mahv=l.mahv";
            sql1 += " left join " + m_user + ".bangcap bc on l.td_nnghiep=bc.mabangcap";
            sql1 += " inner join " + m_user + ".max_lan ml on hd.manv=ml.manv";
            sql1 += " Where m.nhombc =1 and (hd.ngaynghi is null or  to_timestamp(hd.ngaynghi,'yyyy/mm/dd')>=to_timestamp('"+m_nam+"/" +m_thang + "/" + ngay + "','yyyy/mm/dd'))";
            sql1 += " and to_timestamp(hd.ngaydenct,'yyyy/mm/dd') <= to_timestamp('"+m_nam+"/"+m_thang+"/"+ngay+"','yyyy/mm/dd')";
            sql1 += " and hd.lan=ml.lan and bp.mabsoft in ('L','P','C','K','D')";
            DataSet dst1=mDB.get_data(sql1);
			if(dst1.Tables[0].Rows.Count>0)
			{
				dst1.Tables[0].Rows[0][0]=lan.Change_language_MessageText("CB - CNV BIÊN CHẾ");

			}

            sql1 = "SELECT '' as LABEL,Count(l.manv) AS TongNV, sum(case when l.phai='Nữ' then 1 else 0 end) AS nv_Nu,";
            sql1 += " sum(case when l.phai='Nam' then 1 else 0 end) AS nv_Nam, ";
            sql1 += " sum(case when hd.dang='c' or hd.dang='r' Or hd.dang='C' Or hd.dang='R' then 1 else 0 end) AS Dang_v,";
            sql1 += " sum(case when hd.doan='c' Or hd.doan='r' Or hd.doan='C' Or hd.doan='R' then 1 else 0 end)";
            sql1 += " AS Doan_v, sum(case when hd.cong_doan='c' Or hd.cong_doan='r' Or";
            sql1 += " hd.cong_doan='C' Or hd.cong_doan='R' then 1 end) AS CongDoan_v,";
            sql1 += " sum(case when l.mahv in ('0009','0008')  then 1 else 0 end) AS cap1, sum(case when l.mahv in ('0004','0005','0006','0007') then 1 else 0 end ) AS";
            sql1 += " cap2, sum(case when l.mahv in ('0001','0002','0003') then 1 else 0 end) AS cap3, sum(case when bc.mabc in ('DH') then 1 else 0 end )";
            sql1 += " AS daihoc,sum(case when bc.mabc in ('TD') then 1 else 0 end )  AS trendh,";
            sql1 += " sum(case when l.chinhtri='SC' then 1 else 0 end) AS SC_CTri, ";
            sql1 += " sum(case when l.chinhtri='TC' then 1 else 0 end) AS TC_CTri,";
            sql1 += " sum(case when l.chinhtri='CN' then 1 else 0 end) AS CN_CTri,";
            sql1 += " sum(case when l.chinhtri='CC' then 1 else 0 end) AS CC_CTri,";
            sql1 += " sum(case when bc.mabc in ('SH') then 1 else 0 end) AS SH_Cmon, ";
            sql1 += " sum(case when bc.mabc in ('TH') then 1 else 0 end) AS TH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('DH') then 1 else 0 end) AS DH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('TD') then 1 else 0 end) AS TDH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('CD') then 1 else 0 end) AS CD_Cmon,";
            sql1 += "  to_char(now(),'dd') as ngay,'" + m_thang + "' as thang,'" + m_nam + "' as nam ";
            sql1 += " From " + m_user + ".llnv l inner join " + m_user + ".hopdong hd on hd.manv=l.manv";
            sql1 += " left join " + m_user + ".bophan bp on l.madv=bp.madv";
            sql1 += " left join " + m_user + ".mahd m on m.mahd=hd.loaihd";
            sql1 += " left join " + m_user + ".hocvan hv on hv.mahv=l.mahv";
            sql1 += " left join " + m_user + ".bangcap bc on l.td_nnghiep=bc.mabangcap";
            sql1 += " inner join " + m_user + ".max_lan ml on hd.manv=ml.manv";
            sql1 += " where to_number(nullif(to_char(hd.ngaydenct,'mm'),'0'))=" + cbobThang.Value + "";
            sql1 += " and to_number(nullif(to_char(hd.ngaydenct,'yyyy'),'0'))=" + cbobNam.Value + "";
            sql1 += " and hd.lan=ml.lan and bp.mabsoft in ('L','P','C','K','D')"; 

            DataSet dst = mDB.get_data(sql1);
            if (dst.Tables[0].Rows.Count > 0)
            {
                dst.Tables[0].Rows[0][0] =lan.Change_language_MessageText( "TĂNG TRONG THÁNG TUYỂN DỤNG MỚI");
                dst1.Tables[0].Rows.Add(dst.Tables[0].Rows[0].ItemArray);
            }
            sql1 = "SELECT '' as LABEL,Count(l.manv) AS TongNV, sum(case when l.phai='Nữ' then 1 else 0 end) AS nv_Nu,";
            sql1 += " sum(case when l.phai='Nam' then 1 else 0 end) AS nv_Nam, ";
            sql1 += " sum(case when hd.dang='c' or hd.dang='r' Or hd.dang='C' Or hd.dang='R' then 1 else 0 end) AS Dang_v,";
            sql1 += " sum(case when hd.doan='c' Or hd.doan='r' Or hd.doan='C' Or hd.doan='R' then 1 else 0 end)";
            sql1 += " AS Doan_v, sum(case when hd.cong_doan='c' Or hd.cong_doan='r' Or";
            sql1 += " hd.cong_doan='C' Or hd.cong_doan='R' then 1 end) AS CongDoan_v,";
            sql1 += " sum(case when l.mahv in ('0009','0008')  then 1 else 0 end) AS cap1, sum(case when l.mahv in ('0004','0005','0006','0007') then 1 else 0 end ) AS";
            sql1 += " cap2, sum(case when l.mahv in ('0001','0002','0003') then 1 else 0 end) AS cap3, sum(case when bc.mabc in ('DH') then 1 else 0 end )";
            sql1 += " AS daihoc,sum(case when bc.mabc in ('TD') then 1 else 0 end )  AS trendh,";
            sql1 += " sum(case when l.chinhtri='SC' then 1 else 0 end) AS SC_CTri, ";
            sql1 += " sum(case when l.chinhtri='TC' then 1 else 0 end) AS TC_CTri,";
            sql1 += " sum(case when l.chinhtri='CN' then 1 else 0 end) AS CN_CTri,";
            sql1 += " sum(case when l.chinhtri='CC' then 1 else 0 end) AS CC_CTri,";
            sql1 += " sum(case when bc.mabc in ('SH') then 1 else 0 end) AS SH_Cmon, ";
            sql1 += " sum(case when bc.mabc in ('TH') then 1 else 0 end) AS TH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('DH') then 1 else 0 end) AS DH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('TD') then 1 else 0 end) AS TDH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('CD') then 1 else 0 end) AS CD_Cmon,";
            sql1 += " to_char(now(),'dd') as ngay,'" + m_thang + "' as thang,'" + m_nam + "' as nam ";
            sql1 += " From " + m_user + ".llnv l inner join " + m_user + ".hopdong hd on hd.manv=l.manv";
            sql1 += " left join " + m_user + ".bophan bp on l.madv=bp.madv";
            sql1 += " left join " + m_user + ".mahd m on m.mahd=hd.loaihd";
            sql1 += " left join " + m_user + ".hocvan hv on hv.mahv=l.mahv";
            sql1 += " left join " + m_user + ".bangcap bc on l.td_nnghiep=bc.mabangcap";
            sql1 += " inner join " + m_user + ".max_lan ml on hd.manv=ml.manv";
            sql1 += " where to_number(nullif(to_char(hd.ngaynghi,'mm'),'0'))=" + cbobThang.Value + "";
            sql1 += " and to_number(nullif(to_char(hd.ngaynghi,'yyyy'),'0'))=" + cbobNam.Value + "";
            sql1 += " and hd.lan=ml.lan and bp.mabsoft in ('L','P','C','K','D')";
            DataSet ads = mDB.get_data(sql1);
            if (ads.Tables[0].Rows.Count > 0)
            {
                ads.Tables[0].Rows[0][0] =lan.Change_language_MessageText( "GIẢM TRONG THÁNG THÔI VIỆC");
                dst1.Tables[0].Rows.Add(ads.Tables[0].Rows[0].ItemArray);
            }
            sql1 = "SELECT '' as LABEL,Count(l.manv) AS TongNV, sum(case when l.phai='Nữ' then 1 else 0 end) AS nv_Nu,";
            sql1 += " sum(case when l.phai='Nam' then 1 else 0 end) AS nv_Nam, ";
            sql1 += " sum(case when hd.dang='c' or hd.dang='r' Or hd.dang='C' Or hd.dang='R' then 1 else 0 end) AS Dang_v,";
            sql1 += " sum(case when hd.doan='c' Or hd.doan='r' Or hd.doan='C' Or hd.doan='R' then 1 else 0 end)";
            sql1 += " AS Doan_v, sum(case when hd.cong_doan='c' Or hd.cong_doan='r' Or";
            sql1 += " hd.cong_doan='C' Or hd.cong_doan='R' then 1 end) AS CongDoan_v,";
            sql1 += " sum(case when l.mahv in ('0009','0008')  then 1 else 0 end) AS cap1, sum(case when l.mahv in ('0004','0005','0006','0007') then 1 else 0 end ) AS";
            sql1 += " cap2, sum(case when l.mahv in ('0001','0002','0003') then 1 else 0 end) AS cap3, sum(case when bc.mabc in ('DH') then 1 else 0 end )";
            sql1 += " AS daihoc,sum(case when bc.mabc in ('TD') then 1 else 0 end )  AS trendh,";
            sql1 += " sum(case when l.chinhtri='SC' then 1 else 0 end) AS SC_CTri, ";
            sql1 += " sum(case when l.chinhtri='TC' then 1 else 0 end) AS TC_CTri,";
            sql1 += " sum(case when l.chinhtri='CN' then 1 else 0 end) AS CN_CTri,";
            sql1 += " sum(case when l.chinhtri='CC' then 1 else 0 end) AS CC_CTri,";
            sql1 += " sum(case when bc.mabc in ('SH') then 1 else 0 end) AS SH_Cmon, ";
            sql1 += " sum(case when bc.mabc in ('TH') then 1 else 0 end) AS TH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('DH') then 1 else 0 end) AS DH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('TD') then 1 else 0 end) AS TDH_Cmon,";
            sql1 += " sum(case when bc.mabc in ('CD') then 1 else 0 end) AS CD_Cmon,";
            sql1 += " to_char(now(),'dd') as ngay,'" + m_thang + "' as thang,'" + m_nam + "' as nam ";
            sql1 += " From " + m_user + ".llnv l inner join " + m_user + ".hopdong hd on hd.manv=l.manv";
            sql1 += " left join " + m_user + ".bophan bp on l.madv=bp.madv";
            sql1 += " left join " + m_user + ".mahd m on m.mahd=hd.loaihd";
            sql1 += " left join " + m_user + ".hocvan hv on hv.mahv=l.mahv";
            sql1 += " left join " + m_user + ".bangcap bc on l.td_nnghiep=bc.mabangcap";
            sql1 += " inner join " + m_user + ".max_lan ml on hd.manv=ml.manv";
            sql1 += " where  hd.ngaynghi is null ";
            sql1 += " and to_number(nullif(to_char(hd.ngaydenct,'mm'),'0'))=" + cbobThang.Value + "";
            sql1 += " and to_number(nullif(to_char(hd.ngaydenct,'yyyy'),'0'))=" + cbobNam.Value + "";
            sql1 += " and extract(month from age(hd.denngay,hd.tungay))>0 and extract(month from age(hd.denngay,hd.tungay))<=6 ";
            sql1 += " and hd.lan=ml.lan and bp.mabsoft in ('L','P','C','K','D')";
            DataSet ds6 = new DataSet();
            ds6 = mDB.get_data(sql1);
            if (ds6.Tables[0].Rows.Count > 0)
            {
                ds6.Tables[0].Rows[0][0] = " HỢP ĐỒNG DƯỚI 6 THÁNG ";
                dst1.Tables[0].Rows.Add(ds6.Tables[0].Rows[0].ItemArray);
            }
            dst1.WriteXml("..\\xml\\h_ThongKeNhanSu1.xml", XmlWriteMode.WriteSchema);
			if (dst1.Tables[0].Rows.Count>0)
			{
						
					frmReport f=new frmReport(mDB, dst1,lan.Change_language_MessageText("BÁO CÁO THỐNG KÊ TÌNH HÌNH NHÂN SỰ"),"h_ThongKeNhanSu1.rpt",true,user_dn);
					f.ShowDialog(this);
				
			}
			else
				MessageBox.Show(lan.Change_language_MessageText("Chưa có đầy đủ dữ liệu"),lan.Change_language_MessageText("Thông Báo"));
		}
        
		private void frmThongKeNhanSu_Load(object sender, System.EventArgs e)
		{
            ngay = DateTime.Now.Day.ToString().PadLeft(2, '0');
            m_user = mDB.user;
            cbobNam.Value=DateTime.Now.Year;
			cbobThang.Value=DateTime.Now.Month;
		}

		private void butXem_Click(object sender, System.EventArgs e)
		{
			try
			{
                if ((Convert.ToInt32(cbobThang.Value) > DateTime.Now.Month && Convert.ToInt32(cbobNam.Value) >= DateTime.Now.Year) || (Convert.ToInt32(cbobThang.Value) <= DateTime.Now.Month && Convert.ToInt32(cbobNam.Value) > DateTime.Now.Year))
                {
                    MessageBox.Show(lan.Change_language_MessageText(" Tháng năm lớn hơn hiện tại"),lan.Change_language_MessageText( " Thông báo"), MessageBoxButtons.OK);
                    cbobThang.Focus();
                }
                else
                {
                    print(false);
                }
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString(),lan.Change_language_MessageText("Thông báo"));
			}
		}

		private void butIn_Click(object sender, System.EventArgs e)
		{
			print(true);
		}
	}
}
